Skip to content

feat: RFC 9535 compliance with Peggy parser#15

Merged
atamano merged 14 commits intomasterfrom
change-parser-and-impolement-rfc9535
Jan 9, 2026
Merged

feat: RFC 9535 compliance with Peggy parser#15
atamano merged 14 commits intomasterfrom
change-parser-and-impolement-rfc9535

Conversation

@atamano
Copy link
Copy Markdown
Owner

@atamano atamano commented Jan 9, 2026

Summary

This PR achieves full RFC 9535 compliance for jsonpathly by replacing the ANTLR4 parser with Peggy and implementing all required features.

Key Changes

  • Parser Migration: Replaced ANTLR4 with Peggy for smaller bundle size and simpler build
  • RFC 9535 Functions: Implemented all 5 function extensions:
    • length(value) - string/array length or object key count
    • count(nodelist) - count of nodes in nodelist
    • match(string, pattern) - full string I-Regexp match
    • search(string, pattern) - substring I-Regexp match
    • value(nodelist) - extract single value from nodelist
  • I-Regexp Validation (RFC 9485): Reject non-interoperable regex features
  • Normalized Path Format: Single-quoted output with proper escaping
  • Build System: Replaced webpack with tsup for modern ESM/CJS dual output

Bug Fixes

  • Fixed negative-step slice logic
  • Fixed filter expressions with nested queries
  • Fixed empty nodelist comparison semantics
  • Fixed control character escaping in stringify

Breaking Changes

  • Path output format changed from $["key"] to $['key'] (RFC 9535 normalized format)
  • Bumped to v3.0.0

Closes

Test plan

  • All 644 tests passing
  • 100% line coverage for src/handler and src/parser
  • RFC 9535 compliance test suite added
  • Consensus test suite updated

@atamano atamano self-assigned this Jan 9, 2026
@atamano atamano force-pushed the change-parser-and-impolement-rfc9535 branch from 765df85 to c1ccbc9 Compare January 9, 2026 22:26
@atamano atamano force-pushed the change-parser-and-impolement-rfc9535 branch from c1ccbc9 to 9120fa3 Compare January 9, 2026 22:30
@atamano atamano merged commit 413e3dd into master Jan 9, 2026
4 checks passed
@atamano atamano deleted the change-parser-and-impolement-rfc9535 branch January 10, 2026 09:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RFC9535 - filter expression does not return expected results RFC9535 - Function extensions are not supported ( match, search, count, length, value)

1 participant